package com.lehoon.tomato.service.impl;

import com.lehoon.tomato.model.User;
import com.lehoon.tomato.mapper.UserMapper;
import com.lehoon.tomato.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  用户——服务实现类
 * </p>
 *
 * @author wang
 * @since 2020-09-23
 */
@Service
public class UserServiceImpl implements UserService {

    @Resource
    UserMapper userMapper;

    @Override
    public User getUserById(Integer id) {
        return userMapper.getUserById(id);
    }

    @Override
    public User getUserByOpenId(String openId) {
        return userMapper.getUserByOpenId(openId);
    }

    @Override
    public User getUserByUnionId(String unionId) {
        return userMapper.getUserByUnionId(unionId);
    }

    @Override
    public User getUserByXcxOpenId(String xcxopenId) {
        return userMapper.getUserByXcxOpenId(xcxopenId);
    }

    @Override
    public int updateUserInfo(User user) {
        return userMapper.updateUserInfo(user);
    }

    @Override
    public int updateUserAddress(User user) {
        return userMapper.updateUserAddress(user);
    }
}
